package com.shujia.base;

import org.apache.log4j.Logger;
import java.text.SimpleDateFormat;
import java.util.Date;

public class LoggerToFlume {
    public static void main(String[] args) throws InterruptedException {
        //创建一个logger对象
        Logger logger = Logger.getLogger(LoggerToFlume.class.getName());

        //创建一个日期格式化对象
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        //写一个死循环
        while (true) {
            Date date = new Date();
            logger.info("dateToBigdata29: " + sdf.format(date));
            //让线程休眠一会儿
            Thread.sleep(200);
        }

    }
}